﻿@using CodeGenerator
@using RazorLight
@using BXJG.Common;
@inherits TemplatePage<ExecuteContext>
@{
    DisableEncoding = true;//禁止html编码，因为我们是做代码生成器
}
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations.Schema;
@if (Model.Model.IsTree)
{
@:using BXJG.Utils.GeneralTree;    
}
using @Model.Model.CoreShareNamespace;

namespace @Model.Model.CoreNamespace
{
    /// <summary>
    /// @Model.Model.DisplayName
    ///</summary>
    public partial class @Model.Model.EntityName : @(Model.Model.IsTree?$"GeneralTreeEntity<{Model.Model.EntityName}>":( Model.Model.PrimaryField.CSharpType=="int"?"FullAuditedEntity": $"FullAuditedEntity<{Model.Model.PrimaryField.CSharpType}>" )) @(Model.Model.MultiTenantMode== MultiTenantMode.No?"":(Model.Model.MultiTenantMode== MultiTenantMode.Must?", IMustHaveTenant":", IMayHaveTenant")),IShouldInitialize@(Model.Model.NormalFields.Any(x=>x.Name=="IsActive")?", IPassivable":string.Empty)
    {
@if(Model.Model.MultiTenantMode!= MultiTenantMode.No)
{
        @:public int@(Model.Model.MultiTenantMode==  MultiTenantMode.Have?"?":"") TenantId { get; set; }
}

@foreach (var field in Model.Model.NormalFields)
{
        @:/// <summary>
        @:/// @field.DisplayName
        @:///</summary>
        @:public @field.CSharpTypeNullable @field.Name { get; set; }@* @(field.DefaultValue.IsNotNullOrWhiteSpaceBXJG()?$" = { field.DefaultValueProgram };":string.Empty) *@
}
        public void Initialize() { }
    }
}